public class demo2 {
    public static void main(String[] args) throws InterruptedException {
        String[] arr = {"A","B","C"};
        for (int i = 0;i<10;i++){
            for(int x = 0;x<3;x++){
                int finalX = x;
                Thread t = new Thread(()->{
                    System.out.print(arr[finalX]);
                });
                t.start();
                t.join();
            }
            System.out.println();
        }

    }
}
